package com.hh.test.design.adapt;

import java.util.HashMap;
import java.util.Map;

public class Adapte {

	interface Route {
		void connect(String ip);
	}

	class RouteImpe {
		void connect(Map<String, String> map) {
			String url = map.get("url");
			System.out.println("success connect url:" + url);
		}
	}

	class Adaptee implements Route {
		RouteImpe imp;

		public Adaptee(RouteImpe imp) {
			this.imp = imp;
		}

		public void connect(String ip) {
			Map<String, String> m = new HashMap<String, String>();
			m.put("url", ip);
			imp.connect(m);
		}
	}
}
